package com.itlong.cloud.user.smartcard;


import com.itlong.cloud.POJO.DTO.smartcard.SmartCardGetAppUserInfoDTO;
import com.itlong.cloud.POJO.DTO.smartcard.SmartCardSyncDataPullUserBasisInfoDTO;
import com.itlong.cloud.POJO.PO.AppUserInfoPO;
import com.itlong.cloud.POJO.VO.property.AppUserGetDeviceAuthVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      一卡通_用户模块暴露接口。
 * <desc/>
 *
 * @createDate 2017-12-28.
 */
@FeignClient(name="user-service")
public interface ISmartCardUserInfoServiceClient {

    /**
     * <desc>
     *      保存或更新住户信息以及住户项目信息
     * <desc/>
     *
     * @param smartCardSyncDataPullUserBasisInfoDTO 住户信息传输对象
     * @param projectId 项目Id
     * @param isSmartCommunity 是否使用云对讲： 0-否，1-是
     * @return
     * @author zhangs
     * @createDate 2017-11-20
     */
    @RequestMapping(path = "smartCard/syncData/saveOrUpdateSmartCardUserBasisInfo", method = RequestMethod.POST)
    void saveOrUpdateSmartCardUserBasisInfo(
            @RequestBody SmartCardSyncDataPullUserBasisInfoDTO smartCardSyncDataPullUserBasisInfoDTO,
            @RequestParam("projectId") String projectId,
            @RequestParam("isSmartCommunity") Integer isSmartCommunity)throws Exception;


    /**
     * <desc>
     *      根据住户手机号获取住户信息
     * <desc/>
     *
     * @param getAppUserInfoDTO  查询条件
     * @return AppUserInfoPO 住户信息
     * @author zhangs
     * @createDate 2017/11/20
     */
    @RequestMapping(path = "smartCard/syncData/getSmartCardAppUserInfo", method = RequestMethod.POST)
    AppUserInfoPO getSmartCardAppUserInfo(@RequestBody SmartCardGetAppUserInfoDTO getAppUserInfoDTO) throws Exception;

    /**
     * <desc>
     *      与旺龙一卡通对接-处理住户设备权限信息。
     *      一卡通push住户设备权限信息时住户信息为空，先存储住户信息在使用RabbitMQ处理住户设备权限信息
     * <desc/>
     *
     * @param phoneNum  住户手机号
     * @param email  住户邮箱
     * @param projectId  项目Id
     * @param isSmartCommunity  是否使用云对讲： 0-否，1-是
     * @param appUserGetDeviceAuthVOS  住户设备权限数据信息
     * @return
     * @author zhangs
     * @createDate 2017/11/20
     */
    @RequestMapping(path = "smartCard/syncData/handleSmartCardPushDeviceAuth", method = RequestMethod.POST)
    void handleSmartCardPushDeviceAuth(@RequestParam("phoneNum") String phoneNum,
                                       @RequestParam("email") String email,
                                       @RequestParam("projectId") String projectId,
                                       @RequestParam("isSmartCommunity") Integer isSmartCommunity,
                                       @RequestBody List<AppUserGetDeviceAuthVO> appUserGetDeviceAuthVOS) throws Exception;

    /**
     * <desc>
     *      C#端管理中心登陆验证（工程人员）。
     * <desc/>
     *
     * @param projectId 项目编号
     * @param userName 账号
     * @param password 密码
     * @return
     * @author Juguang.S
     * @createDate 2019-03-18
     */
    @RequestMapping(path = "/smartCard/engineerLoginVerifyForCFace",method = RequestMethod.POST)
    Map<String,String> engineerLoginVerifyForCFace(@RequestParam("projectId") String projectId,
                                                   @RequestParam("userName") String userName,
                                                   @RequestParam("password") String password) throws Exception;

    /**
     * <desc>
     *      从缓存中获取token信息
     * </desc>
     *
     * @param token 用户token
     * @return
     * @author Juguang.S
     * @createDate 2019/03/18
     */
    @RequestMapping(path = "/smartCard/retrieve")
    String retrieve(@RequestParam("token")String token);

    /**
     * <desc>
     *      获取用户信息
     * </desc>
     *
     * @param uid
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/11/18
     */
    @RequestMapping(path = "/smartCard/getUserIdByUid")
    String getUserIdByUid(@RequestParam("uid") String uid,@RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      查询通行记录
     * </desc>
     *
     * @param uid
     * @param projectId
     * @param passTime
     * @return
     * @author Jiaqi.X
     * @createDate 2019/11/18
     */
    @RequestMapping(path = "/smartCard/getPassIdByQrcodeInfo")
    String getPassIdByQrcodeInfo(@RequestParam("uid") String uid,@RequestParam("projectId") String projectId,@RequestParam("passTime") String passTime);

    /**
     * <desc>
     *      人脸下发失败回调
     * <desc/>
     *
     * @param projectId 项目编号
     * @param faceFailDesc  下发失败原因描述(中文)
     * @param userId  人脸识别后的faceId
     * @return 标准格式化响应结果
     * @author Juguang.S
     * @createDate 2019/11/12
     */
    @RequestMapping(path = "/smartCard/faceFailCallback",method = RequestMethod.POST)
    void faceFailCallback(@RequestParam("projectId") String projectId,
                          @RequestParam("faceFailDesc") String faceFailDesc,
                          @RequestParam("userId") String userId) throws Exception;

    /**
     * <desc>
     *      更新二维码信息
     * </desc>
     *
     * @param visitorId 访客id
     * @return
     * @Author Zhu.yj
     * @createDate  2021/5/31
     */
    @RequestMapping("/smartCard/qrCode/update")
    String updateQRCode(@RequestParam("visitorId") String visitorId) throws Exception ;

}
